﻿#region 命名空间

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.SessionState;
using WinnerCMS.BLL;
using WinnerCMS.Common;
using WinnerCMS.Model;

#endregion

namespace WinnerCMS.WebUI.Admin.Special
{
    /// <summary>
    ///     AjaxHandler 的摘要说明
    /// </summary>
    public class AjaxHandler : IHttpHandler, IReadOnlySessionState
    {
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var action = context.Request["Action"];
            if (action == "SpecialTreeList")
            {
                var id = 0;
                if (context.Request["id"] != null)
                {
                    id = int.Parse(context.Request["id"]);
                }
                context.Response.Write(SerializableHelper.SerializeToString(new SpecialManage().SpecialTreeList(id),
                    DataFormart.Json));
            }
            else if (action == "OrderByMove")
            {
                new SpecialManage().OrderByMove(int.Parse(context.Request["ID"]), context.Request["Type"]);
            }
        }

        public bool IsReusable
        {
            get { return false; }
        }
    }
}